package com.youlu.campus.base.base;

/**
 * 常规状态枚举
 * @author: YangJ
 * @date: 2020/11/24 18:55
 */
public enum LiveStatusEnum {

    /**
     *
     */
    PENDING(0, "待开播"),

    ON(1, "进行中"),

    OFF(2, "已结束");

    private Integer code;
    private String desc;

    LiveStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getName(Integer code) {
        if (code != null) {
            for (LiveStatusEnum statusEnum : LiveStatusEnum.values()) {
                if (statusEnum.getCode().equals(code)) {
                    return statusEnum.getDesc();
                }
            }
        }
        return "";
    }
}
